const initState = () => {
  return {
    visible: false,
    // visible: true,
    selectTab: 'recharge'
  };
};

const getters = {
};

// actions
const actions = {
  [types.HIDE_CTRL]({commit}){
    commit(types.HIDE_CTRL);
  },

  [types.TOGGLE_CTRL]({commit}){
    commit(types.TOGGLE_CTRL);
  },

  [types.CHANGE_ACTIVE_TAB]({commit}){
    commit(types.CHANGE_ACTIVE_TAB);
  },
};

// mutations
const mutations = {
  [types.HIDE_CTRL] (state) {
    state.visible = false;
  },
  [types.TOGGLE_CTRL] (state, flag) {
    state.visible = flag;
  },
  [types.CHANGE_ACTIVE_TAB](state, activeKey) {
    state.selectTab = activeKey;
  },
};

export default {
  state: initState,
  getters,
  actions,
  mutations,
};
